package File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class FOSDemo1 {
    public static void main(String[] args) throws FileNotFoundException {
        File file = new File("jsd/2406/fos.dat");
        File parent=file.getParentFile();
        System.out.println(parent);

        if(!parent.exists()){
            parent.mkdirs();
            System.out.println("创建成功");
        }
        FileOutputStream fos2 = new FileOutputStream(file);

        fos2.write(3);
        System.out.println("OK");

        fos2.close();
    }
}
